﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site3forAdmin.Master" AutoEventWireup="true" CodeBehind="NewsforAdmin.aspx.cs" Inherits="WebApp.NewsforAdmin" %>

    

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

<script language="javascript" type="text/javascript">
    function validateForm() {
        if (document.getElementById("<%=txtname.ClientID%>").value == "") {
            alert("Name cannot be blank ^^~♥ !");
            document.getElementById("<%=txtname.ClientID%>").focus();
            return false;
        }
        if (document.getElementById("<%=txttopic.ClientID%>").value == "") {
            alert("Topic cannot be blank ^^~♥  !");
            document.getElementById("<%=txtname.ClientID%>").focus();
            return false;
        }
        return true;
    }
    </script>

    <asp:Label ID="Label1" runat="server" Text="Topic Name"></asp:Label>
    <asp:TextBox ID="txtname" runat="server"></asp:TextBox>
    
        <br />
        <br />
        <br />

                <br />
    
    
        <li>
        <asp:Label ID="Label2" runat="server" Text="Topic         " Width="54px"></asp:Label>
        </li>
    
    
        <br />
        <br />
        <asp:TextBox ID="txttopic" runat="server" Height="207px" Width="601px" 
        TextMode="MultiLine"></asp:TextBox>
        
        
            <br />
            <br />
            <br />
               
                    <br />
                    <br />
                        <br />
    <br />
    
                <br />
                <br />
    
        
        <br />
        <br />
        <br />
    
        <asp:Button ID="btn_submit" runat="server" Text="Submit" OnClick="Add_news" OnClientClick="return validateForm();"/>
        <asp:Button ID="btn_reset" runat="server" Text="Reset" OnClick ="ResetAllFields" />
        
        <br />
        <br />
        <br />

        <p><p><p>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            EnableModelValidation="True" onrowcancelingedit="Cancel" 
        onrowdeleting="Delete" onrowediting="Editing" onrowupdating="Update" 
        onselectedindexchanged="Select" Width="996px" >
            <Columns>
                <asp:BoundField DataField="newsID" HeaderText="ID" />
                <asp:BoundField DataField="topicname" HeaderText="Topic Name" />
                <asp:BoundField DataField="topic" HeaderText="Topic" />
                <asp:CommandField ShowDeleteButton="True" />
                <asp:CommandField ShowEditButton="True" />
            </Columns>
        </asp:GridView></p>
    <p>
        <asp:Label ID="lblm" runat="server" Text="Label"></asp:Label>
    </p></p></p>
        <br />
        <br />
        <br />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
